From b1f016182201b6af23d8491f5a26e33ab4c45825 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 12 Jan 2006 15:59:45 +0100 Subject: [PATCH] More debug print cleanups. Signed-off-by: Keir Fraser --- xen/arch/x86/mm.c | 2 +- xen/arch/x86/traps.c | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index ad0ce9d2e3..1b4afa2fa2 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -3017,7 +3017,7 @@ void ptwr_flush(struct domain *d, const int which) /* NB. INVLPG is a serialising instruction: flushes pending updates. */ flush_tlb_one_mask(d->domain_dirty_cpumask, l1va); PTWR_PRINTK("[%c] disconnected_l1va at %p now %"PRIpte"\n", - PTWR_PRINT_WHICH, ptep, trawl l1e_get_intpte(pte)); + PTWR_PRINT_WHICH, ptep, l1e_get_intpte(pte)); /* * STEP 2. Validate any modified PTEs. diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 9929722fab..0213a255bc 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -963,16 +963,26 @@ static int emulate_privileged_op(struct cpu_user_regs *regs) case 0x30: /* WRMSR */ /* Ignore the instruction if unprivileged. */ if ( !IS_PRIV(v->domain) ) - DPRINTK("Non-priv domain attempted WRMSR(%p,%08lx,%08lx).\n", - _p(regs->ecx), (long)regs->eax, (long)regs->edx); + { + u32 l, h; + if ( (regs->ecx != MSR_EFER) || + (rdmsr_user(regs->ecx, l, h) != 0) || + (regs->eax != l) || (regs->edx != h) ) + DPRINTK("Non-priv domain attempted WRMSR %p from " + "%08x:%08x to %08lx:%08lx.\n", + _p(regs->ecx), h, l, (long)regs->edx, (long)regs->eax); + } else if ( wrmsr_user(regs->ecx, regs->eax, regs->edx) ) goto fail; break; case 0x32: /* RDMSR */ if ( !IS_PRIV(v->domain) ) - DPRINTK("Non-priv domain attempted RDMSR(%p,%08lx,%08lx).\n", - _p(regs->ecx), (long)regs->eax, (long)regs->edx); + { + if ( regs->ecx != MSR_EFER ) + DPRINTK("Non-priv domain attempted RDMSR %p.\n", + _p(regs->ecx)); + } /* Everyone can read the MSR space. */ if ( rdmsr_user(regs->ecx, regs->eax, regs->edx) ) goto fail; -- 2.30.2